require(["common", "queryString", "jQuery", "coAjax", "href", "hash_routie"], function(jSouper, QueryString, $, coAjax, href, hash_routie) {
	hash_routie.on("ticket", function() {
		var qs = new QueryString(location.hash);
		coAjax.get(appConfig.user.ticket_list, {
			state: qs.get("state")
		}, function(result) {
			App.set("$Cache.personal.ticket.list", result.result)
		});
	});
	App.set("$Event.personal.ticket.ticket_add_from_factory", function(e, vm) {
		coAjax.post(appConfig.user.ticket_add_from_factory + vm.get("$Cache.personal.ticket.ticket_factory_id"), function(result) {
			alert("success", "领取成功");
			// console.log(result.result);
			var ticket_list = App.get("$Cache.personal.ticket.list");
			ticket_list.unshift(result.result);
			App.set("$Cache.personal.ticket.list", ticket_list);
		});
	});
});